﻿#include <stdio.h>

int gcd(int a, int b) {
    while (b != 0) {
        int temp = b;
        b = a % b;
        a = temp;
    }
    return a;
}

int main() {
    int num1, num2;
    printf("请输入两个正整数：");
    scanf_s("%d %d", &num1, &num2);

    int gcd_val = gcd(num1, num2);
    int lcm_val = (num1 / gcd_val) * num2;

    printf("最大公约数：%d\n", gcd_val);
    printf("最小公倍数：%d\n", lcm_val);
    return 0;
}